home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 2000 August: Tool Chest / Dev.CD Aug 00 TC Disk 2.toast / pc / sample code / human interface toolbox / htmlsample / htmlsample.h < prev    next >
Encoding:
C/C++ Source or Header  |  2000-06-23  |  2.7 KB  |  110 lines

  1. /*
  2.     file HTMLSample.h
  3.     
  4.     Description:
  5.     This file contains constant declarations and exported routine prototypes
  6.     used in the HTMLSample application.
  7.     
  8.     HTMLSample is an application illustrating how to use the new
  9.     HTMLRenderingLib services found in Mac OS 9. HTMLRenderingLib
  10.     is Apple's light-weight HTML rendering engine capable of
  11.     displaying HTML files.
  12.  
  13.     by John Montbriand, 1999.
  14.  
  15.     Copyright: © 1999 by Apple Computer, Inc.
  16.     all rights reserved.
  17.     
  18.     Disclaimer:
  19.     You may incorporate this sample code into your applications without
  20.     restriction, though the sample code has been provided "AS IS" and the
  21.     responsibility for its operation is 100% yours.  However, what you are
  22.     not permitted to do is to redistribute the source as "DSC Sample Code"
  23.     after having made changes. If you're going to re-distribute the source,
  24.     we require that you make it clear in the source that the code was
  25.     descended from Apple Sample Code, but that you've made changes.
  26.     
  27.     Change History (most recent first):
  28.     10/16/99 created by John Montbriand
  29. */
  30.  
  31. #ifndef __HTMLSAMPLE__
  32. #define __HTMLSAMPLE__
  33.  
  34. #include <MacTypes.h>
  35. #include <Events.h>
  36.  
  37.     /* the resource ID of the main menu bar list. */
  38. enum {
  39.     kMenuBarID = 128
  40. };
  41.  
  42.     /* the resource id of the main string list */
  43. enum {
  44.     kMainStringList = 128,
  45.     kNavMessageString = 1
  46. };
  47.  
  48.     /* constants referring to the apple menu */
  49. enum {
  50.     mApple = 128,
  51.     iAbout = 1,
  52.     iFirstAppleItem = 3
  53. };
  54.  
  55.     /* constants referring to the file menu */
  56. enum {
  57.     mFile = 129,
  58.     iOpen = 1,
  59.     iQuit = 3
  60. };
  61.  
  62.     /* constants referring to the edit menu */
  63. enum {
  64.     mEdit = 130,
  65.     iUndo = 1,
  66.     iCut = 3,
  67.     iCopy = 4,
  68.     iPaste = 5,
  69.     iClear = 6
  70. };
  71.  
  72.     /* constants referring to the go menu */
  73. enum {
  74.     mGo = 131,
  75.     iBack = 1,
  76.     iForward = 2,
  77.     iHome = 3,
  78.     iGoSep = 4
  79. };
  80.  
  81.     /* resource ID numbers for alerts that are called
  82.     to report different error conditions. */
  83. enum {
  84.     kOpenFileErrorAlert = 128,
  85.     kOpenApplicationErrorAlert = 130,
  86.     kNoRenderingLibErrorAlert = 131,
  87.     kNoAboutBoxErrorAlert = 132
  88. };
  89.  
  90.     /* resource ID numbers for resources containing
  91.     application relative links to files displayed by the
  92.     application.  These resources contain c-style strings. */
  93. enum {
  94.     kCStyleStringResourceType = 'CSTR',
  95.     kDefaultPageURLString = 128,
  96.     kErrorPageURLString = 129
  97. };
  98.  
  99. /* ParamAlert is a general alert handling routine.  If Apple events exist, then it
  100.     calls AEInteractWithUser to ensure the application is in the forground, and then
  101.     it displays an alert after passing the s1 and s2 parameters to ParamText. */
  102. short ParamAlert(short alertID, StringPtr s1, StringPtr s2);
  103.  
  104. /* HandleEvent is the main event handling routine for the
  105.     application.  ev points to an event record returned by
  106.     WaitNextEvent. */
  107. void HandleEvent(EventRecord *ev);
  108.  
  109. #endif
  110.